﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

using DevExpress.XtraCharts;

namespace Bid5Stock.Module
{
    public partial class ChartStockWeekIndexVolumeSimple : DevExpress.XtraEditors.XtraUserControl
    {
        public ChartControl MainChart
        {
            get
            {
                return chartControl1;
            }
        }
        public ChartStockWeekIndexVolumeSimple()
        {
            InitializeComponent();
        }

        private void chartControl1_CustomDrawSeriesPoint(object sender, CustomDrawSeriesPointEventArgs e)
        {
            if ("成交量".Equals(e.Series.Name) == false)
                return;
            if(e.SeriesPoint.Tag==null)
                return;
             
            BarDrawOptions opt = e.SeriesDrawOptions as BarDrawOptions;
            opt.FillStyle.FillMode = FillMode.Solid;

            if ("+".Equals(e.SeriesPoint.Tag))
            {
                opt.Color = Color.Red;
                opt.Border.Color = Color.Black;
            }
            else
            {
                opt.Color = Color.Green;
                opt.Border.Color = Color.DarkGreen;
            }


        }
    }
}
